<script>
import request from '@/utils/request.js';
// import dingtalk from '@/utils/dingtalk.open.js';

export default {
	globalData: {
		user: {}
	},
	onLaunch: function() {
		
		
	},
	onShow: function() {
		let token = uni.getStorageSync('token');
		if (token) {
			this.getAllPicker();
		}
		
	},
	onHide: function() {
		
	},
	methods: {
		// 获取所有picker
		getAllPicker() {
			let that = this;
			request.request({
				url: '/api/dictionary.picker/index',
				token: true,
				data: {},
				success(res) {
					if (res.code == 200) {
						uni.setStorageSync('allPicker', res.data);
					} else {
						uni.showToast({
							icon: 'none',
							title: res.msg
						});
					}
				},
				fail() {
					uni.showToast({
						icon: 'none',
						title: '请求失败，请稍后重试'
					});
				}
			});
		}
	}
};
</script>

<style lang="less">
/* 解决头条小程序组件内引入字体不生效的问题 */
/* #ifdef MP-TOUTIAO */
@font-face {
	font-family: uniicons;
	src: url('/static/uni.ttf');
}

/* #endif */

page {
	padding-top: 200upx;
}

/* 显示一行，省略号 */
.one_ellipsis {
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
	word-break: break-all;
}

/* 显示两行，省略号 */
.two_ellipsis {
	text-overflow: -o-ellipsis-lastline;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
}
</style>
